//
//  ZZChannelCell.m
//  ExpertApp
//
//  Created by zhangxy on 2017/8/2.
//  Copyright © 2017年 sjhz. All rights reserved.
//

#import "ZZChannelCell.h"

@implementation ZZChannelCell

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        //		NSLog(@"%s", __func__);
    }
    return self;
}

//推荐homelist normal
//内容很多的时候，能正常拉下，不多的时候，容易不下来


-(void)setNavTypeEntity:(NavTypeEntity *)navTypeEntity{
    _navTypeEntity = navTypeEntity;
    
    DLog(@"----name:%@", _navTypeEntity.nav_name);
    
    
    if(_isFrom == 1){
        _newsTVC = [[HomeListController alloc] init];
        _newsTVC.view.frame = self.bounds;
        ((HomeListController *)_newsTVC).entity = navTypeEntity;
    }else if(_isFrom == 2){
        
        _newsTVC = [[TopicListController alloc] init];
        _newsTVC.view.frame = self.bounds;
        ((TopicListController*)_newsTVC).entity = navTypeEntity;
    }else if(_isFrom == 3){
        _newsTVC = [[TalkListController alloc] init];
        _newsTVC.view.frame = self.bounds;
        ((TalkListController*)_newsTVC).entity = navTypeEntity;
    }
    else if(_isFrom == 4){
        _newsTVC = [[ZZUserViewController alloc] init];
        ((ZZUserViewController*)_newsTVC).user_id = [UserUtil getUser].user_id;
        if([navTypeEntity.nav_type isEqual:@"fans"]){
            ((ZZUserViewController*)_newsTVC).userType = MyUserFans;
        }else{
            ((ZZUserViewController*)_newsTVC).userType = MyUserAttent;
        }
        _newsTVC.view.frame = self.bounds;
    }
    
    DLog(@"class:%@", NSStringFromClass(_newsTVC.class));
    
    [self addSubview:_newsTVC.view];
}


-(void)searchNav:(int)type search:(NSString *) text{
    _newsTVC = [[SearchListController alloc] init];
    _newsTVC.view.frame = self.bounds;
    
    ((SearchListController *)_newsTVC).searchType = type;
    ((SearchListController *)_newsTVC).searchText = text;
    
    
    [self addSubview:_newsTVC.view];
}

@end
